import cv2
import numpy as np

from Config import img_path
#腐蚀
img = cv2.imread(img_path)
img2 = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)
#kernel = np.ones((2,2) ,np.uint8)
kernel = cv2.getStructuringElement(cv2.MORPH_RECT,(3,3))
dst = cv2.erode(img2,kernel=kernel,iterations=1)
ret,dts1 = cv2.threshold(dst,95,255,cv2.THRESH_BINARY)
cv2.imshow('m',img2)
cv2.imshow('dst',dst)
cv2.imshow('dst',dts1)
cv2.waitKey(0)